﻿/*
版权所有：版权所有(C) 2011，刘建新
文件编号：M01_Administrator.cs
文件名称：Administrator.cs
系统编号：Z0003007
系统名称：通用办公系统
模块编号：M01
模块名称：信息发布
设计文档：IOA_M01信息发布XDE建模.mdx
完成日期：2011-01-06
作　　者：
内容摘要：表[Administrator]对应的实体类
*/

using System;
using System.Collections;
using System.Data;


namespace Eis51.CampanyCMS.Model.BaseInfoMng
{
		/// <summary>
		/// 类 编 号：
		/// 类 名 称：Administrator
		/// 内容摘要：
		/// </summary>
		
		[Serializable]
		public class Administrator : BaseModel
		{
		#region 自动生成代码
		
			#region 重载Equals/GetHashCode
			/// <summary>
			/// 重载Equals			
			/// </summary>
			public override bool Equals (Object obj)
			{
				if (obj != null && obj is Administrator)
				{
					if (obj == this)
						return true;
					Administrator castObj = (Administrator)obj; 
					
					if (!this.m_Seqno.Equals(castObj.Seqno))
						return false;
						
					if (!this.m_UserName.Equals(castObj.UserName))
						return false;
						
					if (!this.m_PassWord.Equals(castObj.PassWord))
						return false;
						
					if (!this.m_Mytemplatepath.Equals(castObj.Mytemplatepath))
						return false;
						
					if (!this.m_TemplateId.Equals(castObj.TemplateId))
						return false;
						
					if (!this.m_Webpath.Equals(castObj.Webpath))
						return false;
						
					if (!this.m_Createdate.Equals(castObj.Createdate))
						return false;
						
					if (!this.m_Createby.Equals(castObj.Createby))
						return false;
						
					if (!this.m_Lastupdatedate.Equals(castObj.Lastupdatedate))
						return false;
						
					if (!this.m_Lastupdateby.Equals(castObj.Lastupdateby))
						return false;
						
					if (!this.m_Defaultlcid.Equals(castObj.Defaultlcid))
						return false;
						
					if (!this.m_Defaulthomepage.Equals(castObj.Defaulthomepage))
						return false;
						
					if (!this.m_Filepath.Equals(castObj.Filepath))
						return false;
						
					if (!this.m_HtmlCreateFolder.Equals(castObj.HtmlCreateFolder))
						return false;
						
					if (!this.m_Website.Equals(castObj.Website))
						return false;
						
					return true;
				}
				return false;
			}
			
			/// <summary>
			/// 重载GetHashCode
			/// </summary>
			public override int GetHashCode()
			{
					int hash = 0;					
					
					hash = hash <<  8;
					if ((object)m_Seqno != null)
					{
						hash = hash ^ m_Seqno.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_UserName != null)
					{
						hash = hash ^ m_UserName.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_PassWord != null)
					{
						hash = hash ^ m_PassWord.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Mytemplatepath != null)
					{
						hash = hash ^ m_Mytemplatepath.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_TemplateId != null)
					{
						hash = hash ^ m_TemplateId.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Webpath != null)
					{
						hash = hash ^ m_Webpath.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Createdate != null)
					{
						hash = hash ^ m_Createdate.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Createby != null)
					{
						hash = hash ^ m_Createby.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Lastupdatedate != null)
					{
						hash = hash ^ m_Lastupdatedate.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Lastupdateby != null)
					{
						hash = hash ^ m_Lastupdateby.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Defaultlcid != null)
					{
						hash = hash ^ m_Defaultlcid.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Defaulthomepage != null)
					{
						hash = hash ^ m_Defaulthomepage.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Filepath != null)
					{
						hash = hash ^ m_Filepath.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_HtmlCreateFolder != null)
					{
						hash = hash ^ m_HtmlCreateFolder.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Website != null)
					{
						hash = hash ^ m_Website.GetHashCode();
					}
						
					return hash; 
			}
			#endregion
			
			public Administrator()
			{
				MarkNew();
			}						
			
			public Administrator GetOldValue()
			{
				return OldValue as Administrator;
			}
		
		#region Seqno属性
			private int m_Seqno = 0;
			/// <summary>
			/// 属性名称： Seqno
			/// 内容摘要： DB列名：Seqno[主键]
			///            DB类型：int
			/// </summary>
			public int Seqno
			{
				get
					{
						return m_Seqno;
					}
				set
					{
						if (m_Seqno as object == null || !m_Seqno.Equals(value))
						{
							m_Seqno = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region UserName属性
			private string m_UserName = String.Empty;
			/// <summary>
			/// 属性名称： UserName
			/// 内容摘要： DB列名：User_Name[用户名]
			///            DB类型：string
			/// </summary>
			public string UserName
			{
				get
					{
						return m_UserName;
					}
				set
					{
						if (m_UserName as object == null || !m_UserName.Equals(value))
						{
							m_UserName = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region PassWord属性
			private string m_PassWord = String.Empty;
			/// <summary>
			/// 属性名称： PassWord
			/// 内容摘要： DB列名：Pass_word[密码]
			///            DB类型：string
			/// </summary>
			public string PassWord
			{
				get
					{
						return m_PassWord;
					}
				set
					{
						if (m_PassWord as object == null || !m_PassWord.Equals(value))
						{
							m_PassWord = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Mytemplatepath属性
			private string m_Mytemplatepath = String.Empty;
			/// <summary>
			/// 属性名称： Mytemplatepath
			/// 内容摘要： DB列名：MyTemplatePath[模板文件夹]
			///            DB类型：string
			/// </summary>
			public string Mytemplatepath
			{
				get
					{
						return m_Mytemplatepath;
					}
				set
					{
						if (m_Mytemplatepath as object == null || !m_Mytemplatepath.Equals(value))
						{
							m_Mytemplatepath = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region TemplateId属性
			private int m_TemplateId = 0;
			/// <summary>
			/// 属性名称： TemplateId
			/// 内容摘要： DB列名：Template_ID[模板ID]
			///            DB类型：int
			/// </summary>
			public int TemplateId
			{
				get
					{
						return m_TemplateId;
					}
				set
					{
						if (m_TemplateId as object == null || !m_TemplateId.Equals(value))
						{
							m_TemplateId = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Webpath属性
			private string m_Webpath = String.Empty;
			/// <summary>
			/// 属性名称： Webpath
			/// 内容摘要： DB列名：WebPath[网页文件夹]
			///            DB类型：string
			/// </summary>
			public string Webpath
			{
				get
					{
						return m_Webpath;
					}
				set
					{
						if (m_Webpath as object == null || !m_Webpath.Equals(value))
						{
							m_Webpath = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Createdate属性
			private DateTime m_Createdate = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： Createdate
			/// 内容摘要： DB列名：CreateDate[创建时间]
			///            DB类型：DateTime
			/// </summary>
			public DateTime Createdate
			{
				get
					{
						return DateTime.Parse(m_Createdate.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_Createdate as object == null || !m_Createdate.Equals(value))
						{
							m_Createdate = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Createby属性
			private string m_Createby = String.Empty;
			/// <summary>
			/// 属性名称： Createby
			/// 内容摘要： DB列名：CreateBy[创建人]
			///            DB类型：string
			/// </summary>
			public string Createby
			{
				get
					{
						return m_Createby;
					}
				set
					{
						if (m_Createby as object == null || !m_Createby.Equals(value))
						{
							m_Createby = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Lastupdatedate属性
			private DateTime m_Lastupdatedate = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： Lastupdatedate
			/// 内容摘要： DB列名：LastupdateDate[更新时间]
			///            DB类型：DateTime
			/// </summary>
			public DateTime Lastupdatedate
			{
				get
					{
						return DateTime.Parse(m_Lastupdatedate.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_Lastupdatedate as object == null || !m_Lastupdatedate.Equals(value))
						{
							m_Lastupdatedate = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Lastupdateby属性
			private string m_Lastupdateby = String.Empty;
			/// <summary>
			/// 属性名称： Lastupdateby
			/// 内容摘要： DB列名：LastupdateBy[更新人]
			///            DB类型：string
			/// </summary>
			public string Lastupdateby
			{
				get
					{
						return m_Lastupdateby;
					}
				set
					{
						if (m_Lastupdateby as object == null || !m_Lastupdateby.Equals(value))
						{
							m_Lastupdateby = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Defaultlcid属性
			private int m_Defaultlcid = 0;
			/// <summary>
			/// 属性名称： Defaultlcid
			/// 内容摘要： DB列名：DefaultLcid[默认语言]
			///            DB类型：int
			/// </summary>
			public int Defaultlcid
			{
				get
					{
						return m_Defaultlcid;
					}
				set
					{
						if (m_Defaultlcid as object == null || !m_Defaultlcid.Equals(value))
						{
							m_Defaultlcid = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Defaulthomepage属性
			private string m_Defaulthomepage = String.Empty;
			/// <summary>
			/// 属性名称： Defaulthomepage
			/// 内容摘要： DB列名：DefaultHomePage[默认首页地址]
			///            DB类型：string
			/// </summary>
			public string Defaulthomepage
			{
				get
					{
						return m_Defaulthomepage;
					}
				set
					{
						if (m_Defaulthomepage as object == null || !m_Defaulthomepage.Equals(value))
						{
							m_Defaulthomepage = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Filepath属性
			private string m_Filepath = String.Empty;
			/// <summary>
			/// 属性名称： Filepath
			/// 内容摘要： DB列名：FilePath[默认路径]
			///            DB类型：string
			/// </summary>
			public string Filepath
			{
				get
					{
						return m_Filepath;
					}
				set
					{
						if (m_Filepath as object == null || !m_Filepath.Equals(value))
						{
							m_Filepath = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region HtmlCreateFolder属性
			private string m_HtmlCreateFolder = String.Empty;
			/// <summary>
			/// 属性名称： HtmlCreateFolder
			/// 内容摘要： DB列名：Html_Create_Folder[HTML生成目录]
			///            DB类型：string
			/// </summary>
			public string HtmlCreateFolder
			{
				get
					{
						return m_HtmlCreateFolder;
					}
				set
					{
						if (m_HtmlCreateFolder as object == null || !m_HtmlCreateFolder.Equals(value))
						{
							m_HtmlCreateFolder = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Website属性
			private string m_Website = String.Empty;
			/// <summary>
			/// 属性名称： Website
			/// 内容摘要： DB列名：WebSite[站点]
			///            DB类型：string
			/// </summary>
			public string Website
			{
				get
					{
						return m_Website;
					}
				set
					{
						if (m_Website as object == null || !m_Website.Equals(value))
						{
							m_Website = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region static CreateDataTable/FillDataRow/DataRow2Obj/Dt2Objs/FillDataTable
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="tableName">表名</param>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(string tableName,ColumnNameEnum cne)
			{
				DataTable dtResult = new DataTable(tableName);
			
				if (cne == ColumnNameEnum.DBName)
				{
					dtResult.Columns.Add(new DataColumn("Seqno",typeof(int)));
					dtResult.Columns.Add(new DataColumn("User_Name",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Pass_word",typeof(string)));
					dtResult.Columns.Add(new DataColumn("MyTemplatePath",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Template_ID",typeof(int)));
					dtResult.Columns.Add(new DataColumn("WebPath",typeof(string)));
					dtResult.Columns.Add(new DataColumn("CreateDate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("CreateBy",typeof(string)));
					dtResult.Columns.Add(new DataColumn("LastupdateDate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("LastupdateBy",typeof(string)));
					dtResult.Columns.Add(new DataColumn("DefaultLcid",typeof(int)));
					dtResult.Columns.Add(new DataColumn("DefaultHomePage",typeof(string)));
					dtResult.Columns.Add(new DataColumn("FilePath",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Html_Create_Folder",typeof(string)));
					dtResult.Columns.Add(new DataColumn("WebSite",typeof(string)));
				}
				else if (cne == ColumnNameEnum.PropertyName)
				{
					dtResult.Columns.Add(new DataColumn("Seqno",typeof(int)));
					dtResult.Columns.Add(new DataColumn("UserName",typeof(string)));
					dtResult.Columns.Add(new DataColumn("PassWord",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Mytemplatepath",typeof(string)));
					dtResult.Columns.Add(new DataColumn("TemplateId",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Webpath",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Createdate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("Createby",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Lastupdatedate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("Lastupdateby",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Defaultlcid",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Defaulthomepage",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Filepath",typeof(string)));
					dtResult.Columns.Add(new DataColumn("HtmlCreateFolder",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Website",typeof(string)));
				}
				return dtResult;
			}
			
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(ColumnNameEnum cne)
			{
				return CreateDataTable(null,cne);
			}

			/// <summary>
			/// 得到实体对应的DataTable(默认列名映射为属性名)
			/// </summary>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable()
			{
				return CreateDataTable(ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			public void FillDataRow(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				if (ColumnNameEnum.DBName == cne)
				{
					dr["Seqno"] = this.Seqno;
					dr["User_Name"] = this.UserName;
					dr["Pass_word"] = this.PassWord;
					dr["MyTemplatePath"] = this.Mytemplatepath;
					dr["Template_ID"] = this.TemplateId;
					dr["WebPath"] = this.Webpath;
					dr["CreateDate"] = this.Createdate;
					dr["CreateBy"] = this.Createby;
					dr["LastupdateDate"] = this.Lastupdatedate;
					dr["LastupdateBy"] = this.Lastupdateby;
					dr["DefaultLcid"] = this.Defaultlcid;
					dr["DefaultHomePage"] = this.Defaulthomepage;
					dr["FilePath"] = this.Filepath;
					dr["Html_Create_Folder"] = this.HtmlCreateFolder;
					dr["WebSite"] = this.Website;
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					dr["Seqno"] = this.Seqno;
					dr["UserName"] = this.UserName;
					dr["PassWord"] = this.PassWord;
					dr["Mytemplatepath"] = this.Mytemplatepath;
					dr["TemplateId"] = this.TemplateId;
					dr["Webpath"] = this.Webpath;
					dr["Createdate"] = this.Createdate;
					dr["Createby"] = this.Createby;
					dr["Lastupdatedate"] = this.Lastupdatedate;
					dr["Lastupdateby"] = this.Lastupdateby;
					dr["Defaultlcid"] = this.Defaultlcid;
					dr["Defaulthomepage"] = this.Defaulthomepage;
					dr["Filepath"] = this.Filepath;
					dr["HtmlCreateFolder"] = this.HtmlCreateFolder;
					dr["Website"] = this.Website;					
				}
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow(默认列名映射为属性名)
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			public void FillDataRow(DataRow dr)
			{
				this.FillDataRow(dr,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 将DataRow转换成Administrator对象
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			/// <returns>Administrator对象</returns>
			public static Administrator Dr2Obj(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				Administrator obj = new Administrator();
				if (ColumnNameEnum.DBName == cne)
				{
					obj.Seqno = (dr["Seqno"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Seqno"],typeof(int));
					obj.UserName = (dr["User_Name"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["User_Name"],typeof(string));
					obj.PassWord = (dr["Pass_word"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Pass_word"],typeof(string));
					obj.Mytemplatepath = (dr["MyTemplatePath"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["MyTemplatePath"],typeof(string));
					obj.TemplateId = (dr["Template_ID"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Template_ID"],typeof(int));
					obj.Webpath = (dr["WebPath"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["WebPath"],typeof(string));
					obj.Createdate = (dr["CreateDate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["CreateDate"],typeof(DateTime));
					obj.Createby = (dr["CreateBy"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["CreateBy"],typeof(string));
					obj.Lastupdatedate = (dr["LastupdateDate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["LastupdateDate"],typeof(DateTime));
					obj.Lastupdateby = (dr["LastupdateBy"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["LastupdateBy"],typeof(string));
					obj.Defaultlcid = (dr["DefaultLcid"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["DefaultLcid"],typeof(int));
					obj.Defaulthomepage = (dr["DefaultHomePage"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["DefaultHomePage"],typeof(string));
					obj.Filepath = (dr["FilePath"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["FilePath"],typeof(string));
					obj.HtmlCreateFolder = (dr["Html_Create_Folder"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Html_Create_Folder"],typeof(string));
					obj.Website = (dr["WebSite"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["WebSite"],typeof(string));
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					obj.Seqno = (dr["Seqno"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Seqno"],typeof(int));
					obj.UserName = (dr["UserName"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["UserName"],typeof(string));
					obj.PassWord = (dr["PassWord"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["PassWord"],typeof(string));
					obj.Mytemplatepath = (dr["Mytemplatepath"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Mytemplatepath"],typeof(string));
					obj.TemplateId = (dr["TemplateId"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["TemplateId"],typeof(int));
					obj.Webpath = (dr["Webpath"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Webpath"],typeof(string));
					obj.Createdate = (dr["Createdate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["Createdate"],typeof(DateTime));
					obj.Createby = (dr["Createby"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Createby"],typeof(string));
					obj.Lastupdatedate = (dr["Lastupdatedate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["Lastupdatedate"],typeof(DateTime));
					obj.Lastupdateby = (dr["Lastupdateby"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Lastupdateby"],typeof(string));
					obj.Defaultlcid = (dr["Defaultlcid"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Defaultlcid"],typeof(int));
					obj.Defaulthomepage = (dr["Defaulthomepage"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Defaulthomepage"],typeof(string));
					obj.Filepath = (dr["Filepath"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Filepath"],typeof(string));
					obj.HtmlCreateFolder = (dr["HtmlCreateFolder"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["HtmlCreateFolder"],typeof(string));
					obj.Website = (dr["Website"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Website"],typeof(string));		
				}
				
				return obj;
			}
			
			/// <summary>
			/// 将DataRow转换成Administrator对象(默认列名映射为属性名)
			/// </summary>
			/// <returns>Administrator对象</returns>
			public static Administrator Dr2Obj(DataRow dr)
			{
				return Dr2Obj(dr,ColumnNameEnum.DBName);
			}
			
			/// <summary>
			/// 将DataTabe转换成的Administrator对象集合
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			/// <returns>Administrator对象的集合</returns>
			public static IList Dt2Objs(DataTable dt,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				
				ArrayList alResult = new ArrayList();
				
				foreach(DataRow dr in dt.Rows)
				{
					alResult.Add(Dr2Obj(dr,cne));
				}
				
				return alResult;
			}

			/// <summary>
			/// 将DataTabe转换成的Administrator对象集合(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <returns>Administrator对象的集合</returns>
			public static IList Dt2Objs(DataTable dt)
			{
				return Dt2Objs(dt,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用objs的Administrator对象集合填充DataTable
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">Administrator对象集合</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			public static void FillDataTable(DataTable dt,IList objs,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				if (objs == null)
				{
					throw new ArgumentNullException("objs");
				}
				
				foreach(Administrator obj in objs)
				{
					DataRow dr = dt.NewRow();
					obj.FillDataRow(dr,cne);
					dt.Rows.Add(dr);
				}
			}

			/// <summary>
			/// 用objs的Administrator对象集合填充DataTable(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">Administrator对象集合</param>
			public static void FillDataTable(DataTable dt,IList objs)
			{
				FillDataTable(dt,objs,ColumnNameEnum.PropertyName);
			}
		#endregion
		
		/// <summary>
		/// 取消编辑,恢复到上次有效调用BeginEdit前的状态,并清空保留值
		/// </summary>
		public override void CancelEdit()
		{
			Administrator old = this.OldValue as Administrator;
			if (old != null)
			{
					this.Seqno = old.Seqno;
					this.UserName = old.UserName;
					this.PassWord = old.PassWord;
					this.Mytemplatepath = old.Mytemplatepath;
					this.TemplateId = old.TemplateId;
					this.Webpath = old.Webpath;
					this.Createdate = old.Createdate;
					this.Createby = old.Createby;
					this.Lastupdatedate = old.Lastupdatedate;
					this.Lastupdateby = old.Lastupdateby;
					this.Defaultlcid = old.Defaultlcid;
					this.Defaulthomepage = old.Defaulthomepage;
					this.Filepath = old.Filepath;
					this.HtmlCreateFolder = old.HtmlCreateFolder;
					this.Website = old.Website;				
				this.OldValue = null;
			}
		}
		
		
		
		
		#region Administrator实体的内部Key类
			/// <summary>
			/// Administrator实体的Key类
			/// </summary>
			public sealed class Key
			{
		
				private int m_Seqno;
				public int Seqno
				{
 					get 
					{ 
						 return m_Seqno; 
					}
					set 
					{ 
						m_Seqno = value;
					}
				}
		
				public Key(int pSeqno)
				{
					m_Seqno=pSeqno;

				}
			}
		#endregion
			/// <summary>
			/// 得到实体Administrator的PK
			/// </summary>
			public Key GetKey()
			{
				return new Key(Seqno);				
			}
			
				
		#endregion
	}
}
